<section class="content-header">
    <h1>添加路线</h1>
</section>

<section class="content">
    <div class="box box-primary">
        <form class="form-horizontal" name="lines_creat_form" novalidate="novalidate" ng-submit="linesCreatForm()">
            <div class="box-body">
                <div class="form-group pt7 has-success">
                    <label class="col-sm-2 control-label">添加类型</label>
                    <div class="col-sm-9 pt7">
                        <label><input type="radio" name="lineType" value="0" ng-model="lineType" style="margin: 0 5px;" ng-click="baseData()" /> 批量添加</label>
                        <label><input type="radio" name="lineType" value="1" ng-model="lineType" style="margin: 0 5px 0 15px;" ng-click="baseData()" /> 单日添加</label>
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': lines_creat_form.region_id.$dirty && lines_creat_form.region_id.$valid && !lines_creat_form.region_id.$focused, 'has-error': lines_creat_form.region_id.$dirty && lines_creat_form.region_id.$invalid && !lines_creat_form.region_id.$focused}">
                    <label for="mobile" class="col-sm-2 control-label">选择景区</label>
                    <div class="col-sm-9">
                        <select class="form-control" id="region_id" name="region_id" ng-model="line.region_id" ng-options="region.region_id as region.name for region in regions" required>
                            <option value="">选择景区</option>
                        </select>
                    </div>
                </div>
                <div class="form-group has-success" ng-show="lineType == 0">
                    <label class="control-label col-sm-2">出发范围</label>
                    <div class="input-group col-sm-9" style="padding-left: 15px;padding-right: 15px;">
                        <div class="input-group-addon" style="border-radius: 5px 0 0 5px!important;">
                            <i class="fa fa-calendar"></i>
                        </div>
                        <input id="multiTime" type="text" class="form-control pull-right" style="border-radius: 0 5px 5px 0!important;" />
                    </div>
                </div>
                <div class="form-group pt7" ng-show="lineType == 0" ng-class="{'has-success': line.choose_date.day1 || line.choose_date.day2 || line.choose_date.day3 || line.choose_date.day4 || line.choose_date.day5 || line.choose_date.day6 || line.choose_date.day7, 'has-error': !line.choose_date.day1 && !line.choose_date.day2 && !line.choose_date.day3 && !line.choose_date.day4 && !line.choose_date.day5 && !line.choose_date.day6 && !line.choose_date.day7 && lines_creat_form.choose_date.$dirty}">
                    <label for="mobile" class="col-sm-2 control-label">选择周期</label>
                    <div class="col-sm-9 pt7">
                        <label><input type="checkbox" name="choose_date" ng-model="line.choose_date.day1" style="margin: 0 5px;" /> 周一</label>
                        <label><input type="checkbox" name="choose_date" ng-model="line.choose_date.day2" style="margin: 0 5px;" /> 周二</label>
                        <label><input type="checkbox" name="choose_date" ng-model="line.choose_date.day3" style="margin: 0 5px;" /> 周三</label>
                        <label><input type="checkbox" name="choose_date" ng-model="line.choose_date.day4" style="margin: 0 5px;" /> 周四</label>
                        <label><input type="checkbox" name="choose_date" ng-model="line.choose_date.day5" style="margin: 0 5px;" /> 周五</label>
                        <label><input type="checkbox" name="choose_date" ng-model="line.choose_date.day6" style="margin: 0 5px;" /> 周六</label>
                        <label><input type="checkbox" name="choose_date" ng-model="line.choose_date.day7" style="margin: 0 5px;" /> 周日</label>
                    </div>
                </div>
                <div class="form-group has-success" ng-show="lineType == 1">
                    <label class="control-label col-sm-2">出发范围</label>
                    <div class="input-group col-sm-9" style="padding-left: 15px;padding-right: 15px;">
                        <div class="input-group-addon" style="border-radius: 5px 0 0 5px!important;">
                            <i class="fa fa-calendar"></i>
                        </div>
                        <input id="singleTime" type="text" class="form-control pull-right" style="border-radius: 0 5px 5px 0!important;" />
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary pull-right" ng-disabled="lines_creat_form.$invalid">添加</button>
            </div>
        </form>
    </div>
</section>